package org.example.learn_example.vo;

import lombok.Data;
import lombok.ToString;
import org.example.learn_example.utils.MazeUtils;

import java.util.List;


/*
*
*点定义
* 左上角第一个点为 1,1
*
* */
@Data
@ToString
public class MazePoint {



    private int x;
    private int y;

    public MazePoint(){
        this.x=0;
        this.y=0;
    }

    public MazePoint(int x,int y){
        this.x=x;
        this.y=y;
    }

    public boolean isValidPoint(){
        if (this.x>0 && this.x<= MazeUtils.WIDTH && this.y>0 && this.y<=MazeUtils.HEIGHT){
            return true;
        }
        return false;
    }

    public boolean isEquals(MazePoint anotherPoint){
        if (this.x==anotherPoint.getX() && this.y==anotherPoint.getY()){
            return true;
        }
        return false;
    }

//    定义相邻点的函数不应该放在点定义里面
//    public List<MazePoint> getAdjoinPoint(){
//        return null;
//    }
}
